<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>获取变量的字符串值</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.settype.html">settype</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.unserialize.html">unserialize</a></div>
 <div class="up"><a href="ref.var.html">Variable handling 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.strval" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">strval</h1>
    <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">strval</span> &mdash; <span class="dc-title">获取变量的字符串值</span></p>

   </div>
   <div class="refsect1 unknown-seealsp" id="refsect1-function.strval-unknown-seealsp">
    <h3 class="title">描述</h3>
     <div class="methodsynopsis dc-description">
      <span class="type">string</span> <span class="methodname"><strong>strval</strong></span>
       ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$var</code></span>
      )</div>

    <p class="simpara">
     返回 <em><code class="parameter">var</code></em> 的 <span class="type"><a href="language.types.string.html" class="type string">string</a></span> 值。
     参见 <span class="type"><a href="language.types.string.html" class="type string">string</a></span> 文档获取更多关于字符串转换的信息。
    </p>
    <p class="simpara">
     <em><code class="parameter">var</code></em> 可以是任何标量类型。不能将
     <span class="function"><strong>strval()</strong></span> 用于数组或对象。
    </p>
    <p class="simpara">
     参见 <span class="function"><a href="function.floatval.html" class="function">floatval()</a></span>、<span class="function"><a href="function.intval.html" class="function">intval()</a></span>、<span class="function"><a href="function.settype.html" class="function">settype()</a></span> 和<a href="language.types.type-juggling.html" class="link">类型戏法</a>。
    </p>
   </div>

  </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.settype.html">settype</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.unserialize.html">unserialize</a></div>
 <div class="up"><a href="ref.var.html">Variable handling 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
